﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HFController;
namespace HFWebApp.user
{
    public partial class uc_LawyerAsk : BagePages
    {
        public string Titles { get; set; }
        public string PageString { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.checkAccountIsLogin();

            int PageSize = 10;
            int PageNumber = 1;
            if (this.GetQuery("Page") != "")
            {
                PageNumber = int.Parse(this.GetQuery("Page"));
            }
            int total = 0;
            string strWhere = "UserID="+this.getLoginAccount().ID.ToString();

            if (this.GetQuery("typeid") == "1")
            {
                Titles = "已回复咨询";
                strWhere = strWhere + " and isReply=1";
            }
            else
            {
                Titles = "我的咨询";
            }
            Repeater1.DataSource = LawyerController.getController().getLawyerNoteList(PageSize, PageNumber, strWhere, out total);
            Repeater1.DataBind();
            PageString = LLL.Pager.TrunPageHtmlCode_Web(PageSize, PageNumber, total, "");
        }

        public string getLawyerName(string LawyerID)
        {
            hf.Model.Lawyer lawyer = LawyerController.getController().getLawyerModel(int.Parse(LawyerID));
            if (lawyer != null)
            {
                return lawyer.RealName;
            }
            else {
                return "";
            }
        }
    }
}